package cn.ac.siom.query.action;

import cn.ac.siom.query.service.ITab_ThesisService;
import cn.ac.siom.query.service.IaccessService;
import cn.ac.siom.query.service.InfoLinkService;
import cn.ac.siom.query.util.action.DefaultAction;
import cn.ac.siom.query.vo.Accessinfo;
import cn.ac.siom.query.vo.InfoLink;
import cn.ac.siom.query.vo.Tab_Thesis;
import cn.ac.siom.query.vo.resultType_jl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin
@SuppressWarnings("unchecked")
@Controller
@RequestMapping(value = "/home/*")
public class Tab_ThesisAction extends DefaultAction {

    @Resource
    private ITab_ThesisService tab_ThesisService;

    @Resource
    private IaccessService iaccessService;

    @Resource
    private InfoLinkService infoLinkService;

    @RequestMapping(value = "tab_Thesis_Journal")
    public void tab_Thesis_Journal_list(HttpServletRequest request, HttpServletResponse response) {
        try {
            insertAccessinfo(request,"首页期刊论文");
            super.printObjectToList(response, "allTab_Thesis_Journal", this.tab_ThesisService.list_Journal());
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    @RequestMapping(value = "findBookSection")
    public void findBookSection(HttpServletRequest request, HttpServletResponse response) {
        try {
            insertAccessinfo(request,"首页图书章节");
            super.printObjectToList(response, "bookSection", this.tab_ThesisService.findBookSection());
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    /**
     *没有用到此接口
     */
    @RequestMapping(value = "tab_Thesis_Conference")
    public void tab_Thesis_Conference_list(HttpServletRequest request, HttpServletResponse response) {
        try {
            insertAccessinfo(request,"首页会议论文");
            super.printObjectToList(response, "allTab_Thesis_Conference", this.tab_ThesisService.list_Conference());
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    @ResponseBody
    @RequestMapping(value = "findNO", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<Tab_Thesis> findNO(Integer i_id, HttpServletRequest request, Accessinfo accessinfo, HttpServletResponse response) throws SQLException, IOException, InterruptedException {
        response.setHeader("Access-Control-Allow-Origin", "*");
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        String url = request.getHeader("Referer");
        if (url == null) {
            accessinfo.setUrl("/");
        } else {
            accessinfo.setUrl(url);

            String[] url1 = url.split("=");
            String[] url2 = url1[1].split("&");
            boolean url3 = url2[0].equals("1");
            boolean url4 = url2[0].equals("2");
            boolean url5 = url2[0].equals("3");
            boolean url6 = url2[0].equals("4");
            accessinfo.setIp(ip);
            if (url3) {
                accessinfo.setName("科技报告详情页");
            }
            if (url4) {
                accessinfo.setName("期刊论文详情页");
            }
            if (url5) {
                accessinfo.setName("会议论文详情页");
            }
            if (url6) {
                accessinfo.setName("专业图书详情页");
            }
        }
        this.iaccessService.insertOne(accessinfo);
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_NO(i_id);
        return tab_Thesis;
    }

    @ResponseBody
    @RequestMapping(value = "findPage", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map<String, Object> findPage(Integer rownum, Integer page_id, String keywords, HttpServletRequest request, Accessinfo accessinfo) throws SQLException {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }

        String url = request.getHeader("Referer");
        if (url == null) {
            accessinfo.setUrl("/");
        } else {
            accessinfo.setUrl(url);
        }
        accessinfo.setName(keywords);
        accessinfo.setIp(ip);
        this.iaccessService.insertOne(accessinfo);
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_page(rownum, page_id, keywords);
        Integer cont = this.tab_ThesisService.list_count(keywords);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("cont", cont);
        map.put("page_id", page_id);
        return map;
    }

    //期刊论文详情页引用接口
    @ResponseBody
    @RequestMapping(value = "findReference", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map findReference(HttpServletRequest request, String keywords, Integer i_id) throws SQLException, IOException {
        insertAccessinfo(request,"");
        Tab_Thesis tab_Thesis = this.tab_ThesisService.list_reference(i_id);
        Map map = new HashMap<>();
        String ui2 = tab_Thesis.getField82();
        if (ui2 != null && ui2.length() == 19) {
            String[] ui1 = ui2.split("\\:");
            String ui = ui1[1];
            StringBuffer sb = new StringBuffer("<?xml version=\"1.0\"             encoding=\"utf-8\"  ?>");
            sb.append("<request xmlns=\"http://www.isinet.com/xrpc41\">");
            sb.append("<fn name=\"LinksAMR.retrieve\">");
            sb.append("<list>");
            sb.append("<map>");
            sb.append("</map>");
            sb.append("<map>");
            sb.append("<list name=\"WOS\">");
            sb.append("<val>timesCited</val>");
            sb.append("<val>citingArticlesURL</val>");
            sb.append("</list>");
            sb.append("</map>");
            sb.append("<map>");
            sb.append("<map name=\"cite_1\">");
            System.out.println("ui:" + ui);
            sb.append("<val name=\"ut\">" + ui + "</val>");
            sb.append("</map>");
            sb.append("</map>");
            sb.append("</list>");
            sb.append("</fn>");
            sb.append("</request>");

            URL url = new URL("https://ws.isiknowledge.com/cps/xrpc");
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestProperty("Content-Type", "text/xml;charset=UTF-8");
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Charset", "UTF-8");
            conn.setRequestProperty("Content-Length", String.valueOf(sb.length()));
            conn.setRequestProperty("Connection", "Keep-Alive");
            conn.setConnectTimeout(5000);
            conn.setDoOutput(true);
            OutputStream os = conn.getOutputStream();
            os.write(sb.toString().getBytes("UTF-8"));
            os.flush();
            os.close();
            if (conn.getResponseCode() == 200) {
                String line = null;
                String body = "";
                InputStream is = conn.getInputStream();
                BufferedReader br = new BufferedReader(new InputStreamReader(is));
                while ((line = br.readLine()) != null) {
                    body += line;

                }
                if (body.indexOf("<val name=\"timesCited\">") == -1) {
                    map.put("Reference", 0);
                } else {
                    ui = body.substring(body.indexOf("<val name=\"timesCited\">"), body.lastIndexOf("</val>"));
                    String linkstr = body.substring(body.lastIndexOf("http://"), body.indexOf("]]>"));
                    System.out.println("&nbsp;<a href=\"" + linkstr + "\" target=\"_blank\">" + ui + "</a>");
                    map.put("Reference", ui);
                    System.out.println(linkstr);
                    System.out.println(ui);
                }
            }
            conn.disconnect();
            return map;
        }
        return null;
    }

    @ResponseBody
    @RequestMapping(value = "findNO_tj", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<Tab_Thesis> findNO_tj(Integer i_id, HttpServletRequest request, Accessinfo accessinfo) throws SQLException {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        String url = request.getHeader("Referer");
        if (url == null) {
            accessinfo.setUrl("/");
        } else {
            accessinfo.setUrl(url);
        }
        accessinfo.setIp(ip);
        accessinfo.setName("编辑推荐详情页");
        this.iaccessService.insertOne(accessinfo);
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_tj(i_id);
        return tab_Thesis;
    }

    @ResponseBody
    @RequestMapping(value = "find_tj_Page", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map<String, Object> find_tj_Page(HttpServletResponse response, Integer rownum, Integer page_id, HttpServletRequest request, Accessinfo accessinfo) throws SQLException {
        response.setHeader("Access-Control-Allow-Origin", "*");
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }

        String url = request.getHeader("Referer");
        if (url == null) {
            accessinfo.setUrl("/");
        } else {
            if (url.contains("?")) {
                accessinfo.setUrl(url);
                accessinfo.setIp(ip);
                accessinfo.setName("编辑推荐分页显示");
                this.iaccessService.insertOne(accessinfo);
            }
        }
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_page_tj(rownum, page_id);
        Integer cont = this.tab_ThesisService.list_count_tj();
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("cont", cont);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "findBy_book_id", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<Tab_Thesis> findBy_book_id(String id) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_ByBooksID(id);
        return tab_Thesis;
    }

    @ResponseBody
    @RequestMapping(value = "findSearch_jl", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map findSearch_jl(Integer page_id, String keywords, Integer type, String mold,  Accessinfo accessinfo) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_Search_jl(page_id, keywords, type, mold);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "SearchCount_jl", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> SearchCount_jl(String keywords, String mold) throws SQLException {
        List cont = this.tab_ThesisService.search_count_jl(keywords, mold);
        return cont;
    }

    @ResponseBody
    @RequestMapping(value = "CountPage_jl", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer CountPage_jl(String keywords, String value, Integer type) throws SQLException {
        Integer cont = this.tab_ThesisService.CountPage_jl(keywords, value, type);
        return cont;
    }


    @ResponseBody
    @RequestMapping(value = "SearchCount_new", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer findSearch_new(String keywords) throws SQLException {
        Integer cont = this.tab_ThesisService.search_count(keywords);
        return cont;
    }


    @ResponseBody
    @RequestMapping(value = "findNO_kj", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<Tab_Thesis> findNO_kj(Integer i_id, HttpServletRequest request, Accessinfo accessinfo) throws SQLException {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        String url = request.getHeader("Referer");
        if (url == null) {
            accessinfo.setUrl("/");
        } else {
            accessinfo.setUrl(url);
        }
        accessinfo.setIp(ip);
        accessinfo.setName("科技报告详情页");
        this.iaccessService.insertOne(accessinfo);
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_kj(i_id);
        return tab_Thesis;
    }

    @ResponseBody
    @RequestMapping(value = "find_kj_Page", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map<String, Object> find_kj_Page(Integer rownum, Integer page_id, HttpServletRequest request, Accessinfo accessinfo) throws SQLException {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        String url = request.getHeader("Referer");
        if (url == null) {
            accessinfo.setUrl("/");
        } else {
            if (url.contains("?")) {
                accessinfo.setUrl(url);
                accessinfo.setIp(ip);
                accessinfo.setName("科技报告分页显示");
                this.iaccessService.insertOne(accessinfo);
            }
        }
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_page_kj(rownum, page_id);
        Integer cont = this.tab_ThesisService.list_count_kj();
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("cont", cont);
        map.put("page_id", page_id);
        return map;
    }

    @RequestMapping(value = "find_home_kj")
    public void tab_Thesis_kj_list(HttpServletResponse response) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        try {
            super.printObjectToList(response, "Tab_Thesis_kj", this.tab_ThesisService.list_kj_home());
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    @Override
    public String getText() {
        return null;
    }

    /**
     * 骨干网激光通讯
     */
    @ResponseBody
    @RequestMapping(value = "geosynchronous_orbit", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map geosynchronousOrbit(Integer page_id, @RequestParam(required = false) String mold, @RequestParam(required = false) Integer type) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.search1(page_id, mold, type);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "geosynchronous_orbit_count", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer geosynchronousOrbitCount() throws SQLException {
        int count = this.tab_ThesisService.count1();
        return count;
    }

    @ResponseBody
    @RequestMapping(value = "geosynchronous_orbit_stat", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> geosynchronousOrbitStat(String mold) throws SQLException {
        List cont = this.tab_ThesisService.stat1(mold);
        return cont;
    }

    @ResponseBody
    @RequestMapping(value = "small_low_Earth_orbit", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map smallLowEarthOrbit(Integer page_id, HttpServletRequest request, @RequestParam(required = false) String mold, @RequestParam(required = false) Integer type) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.search2(page_id, mold, type);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "small_low_Earth_orbit_count", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer smallLowEarthOrbitCount() throws SQLException {
        int count = this.tab_ThesisService.count2();
        return count;
    }

    @ResponseBody
    @RequestMapping(value = "small_low_Earth_orbit_stat", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> smallLowEarthOrbitStat(String mold) throws SQLException {
        List cont = this.tab_ThesisService.stat2(mold);
        return cont;
    }

    @ResponseBody
    @RequestMapping(value = "optical_communications_links", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map opticalCommunicationsLinks(Integer page_id, HttpServletRequest request, @RequestParam(required = false) String mold, @RequestParam(required = false) Integer type) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.search3(page_id, mold, type);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "optical_communications_links_count", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer opticalCommunicationsLinksCount() throws SQLException {
        int count = this.tab_ThesisService.count3();
        return count;
    }

    @ResponseBody
    @RequestMapping(value = "optical_communications_links_stat", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> sopticalCommunicationsLinksStat(String mold) throws SQLException {
        List cont = this.tab_ThesisService.stat3(mold);
        return cont;
    }

    @ResponseBody
    @RequestMapping(value = "deep_space", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map deepSpace(Integer page_id, HttpServletRequest request, @RequestParam(required = false) String mold, @RequestParam(required = false) Integer type) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.search4(page_id, mold, type);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "deep_space_count", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer deepSpaceCount() throws SQLException {
        int count = this.tab_ThesisService.count4();
        return count;
    }

    @ResponseBody
    @RequestMapping(value = "deep_space_stat", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> deepSpaceStat(String mold) throws SQLException {
        List cont = this.tab_ThesisService.stat4(mold);
        return cont;
    }

    @ResponseBody
    @RequestMapping(value = "laser_and_ranging_and_communication", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map laserAndRangingAndCommunication(Integer page_id, HttpServletRequest request, @RequestParam(required = false) String mold, @RequestParam(required = false) Integer type) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.search5(page_id, mold, type);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "laser_and_ranging_and_communication_count", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer laserAndRangingAndCommunicationCount() throws SQLException {
        int count = this.tab_ThesisService.count5();
        return count;
    }

    @ResponseBody
    @RequestMapping(value = "laser_and_ranging_and_communication_stat", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> laserAndRangingAndCommunicationStat(String mold) throws SQLException {
        List cont = this.tab_ThesisService.stat5(mold);
        return cont;
    }


    @ResponseBody
    @RequestMapping(value = "simpleSearch", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map simpleSearch(Integer page_id, String title, String author, String publisher, String metting,String keywords) throws SQLException {
        //List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.list_Search(20, page_id, keywords);

        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.combSearch(page_id, title, author, publisher, metting, "and", "and", "and");
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "simpleSearchStat", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> simpleSearchStat(String keywords, String mold) throws SQLException {
        List cont = this.tab_ThesisService.search_count_jl(keywords, mold);
        return cont;
    }

    /**
     * @param keywords
     * @return
     * @throws SQLException
     */
    @ResponseBody
    @RequestMapping(value = "simpleSearchCount", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer simpleSearchCount(String keywords) throws SQLException {
        Integer cont = this.tab_ThesisService.search_count(keywords);
        return cont;
    }


    @ResponseBody
    @RequestMapping(value = "combSearch", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Map combSearch(Integer page_id, String title, String author, String publisher, String metting, String op1, String op2, String op3) throws SQLException {
        List<Tab_Thesis> tab_Thesis = this.tab_ThesisService.combSearch(page_id, title, author, publisher, metting, op1, op2, op3);
        Map<String, Object> map = new HashMap<>();
        map.put("tab_Thesis", tab_Thesis);
        map.put("page_id", page_id);
        return map;
    }

    @ResponseBody
    @RequestMapping(value = "combSearchCount", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public Integer combSearchCount(Integer page_id, String title, String author, String publisher, String metting, String op1, String op2, String op3) throws SQLException {
        Integer count = this.tab_ThesisService.combSearchCount(page_id, title, author, publisher, metting, op1, op2, op3);
        return count;
    }

    @ResponseBody
    @RequestMapping(value = "combSearchStat", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<resultType_jl> combSearchStat(String title, String author, String publisher, String metting, String op1, String op2, String op3, String mold) throws SQLException {
        List cont = this.tab_ThesisService.combSearchStat(title, author, publisher, metting, op1, op2, op3, mold);
        return cont;
    }

    @ResponseBody
    @RequestMapping(value = "footerAd", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public List<InfoLink> footerAd(HttpServletRequest request) throws SQLException {
        insertAccessinfo(request,"");
        List cont = this.infoLinkService.selectT1T2();
        return cont;
    }
}

